package com.chinaunicom.mybatis;

import org.apache.ibatis.session.Configuration;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author liry
 * @version 1.0
 * @date Created on 2022/1/17 17:06
 * Description:
 */
public class MybatisTest {

    public static void main(String[] args) {

        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:beans-mybatis.xml");

        OrderMapper orderMapper = (OrderMapper) applicationContext.getBean("orderMapper");

//        SqlSessionFactoryBean sqlSessionFactoryBean = (SqlSessionFactoryBean) applicationContext.getBean("sqlSessionFactoryBean");
//        sqlSessionFactoryBean.setConfiguration(new Configuration());

        System.out.println(orderMapper.getOrder("1"));

    }
}
